package com.tech.koufu.tools;

import java.util.HashMap;
import java.util.Map;

import org.json.JSONObject;

import com.android.volley.AuthFailureError;
import com.android.volley.Response.ErrorListener;
import com.android.volley.Response.Listener;
import com.android.volley.toolbox.JsonObjectRequest;
import com.android.volley.toolbox.StringRequest;

public class CookieRequest extends JsonObjectRequest{
	
	   public Map mHeaders=new HashMap(1);

	    public CookieRequest(String url, JSONObject jsonRequest, Listener listener,
	                                   ErrorListener errorListener) {
	        super(url, jsonRequest, listener, errorListener);
	    }

	    public CookieRequest(int method, String url, JSONObject jsonRequest, Listener listener,
	                                   ErrorListener errorListener) {
	        super(method, url, jsonRequest, listener, errorListener);
	    }
	    
	    public void setHeader(String cookie){
	        mHeaders.put("Cookie", cookie);
	        mHeaders.put("User-Agent", "curl/7.37.1");
	    }

	    @Override
	    public Map getHeaders() throws AuthFailureError {
	    	
	        return mHeaders;
	    }
}
